<template>
  <div class="common-layout">
    <el-container>
      <el-aside width="auto">
        <AsideBut />
      </el-aside>
      <el-container>
        <el-header>
          <MainTop></MainTop>
          <div>
            <h2 @click="changedrawer" class="point">欢迎您，{{ Administrator }}</h2>
            <AdminiStrator></AdminiStrator>
          </div>
        </el-header>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script setup lang="ts">
import AsideBut from "../../components/AsideBut.vue";
import MainTop from "@/components/MainTop.vue";
import { ref } from "@vue/reactivity";
import AdminiStrator from "../AdminiStrator.vue";
import { useStore } from "vuex";

//管理员
const Administrator = ref(localStorage.getItem("token"));

//全局状态管理
const store = useStore();

//弹出管理员操作面板
const changedrawer = () => {
  store.commit("CHANGE_DRAWER", true);
};
</script>
<style lang="scss" >
.common-layout {
  .el-aside {
    background-color: #545c64;
  }
  .el-header {
    background-color: #f4f4f5;
  }
  .el-main {
    background-color: gainsboro;
  }
}
.point {
  cursor: pointer;
}
// 高度100%
.el-aside,
.el-container,
.common-layout,
#app,
body,
html {
  height: 100%;
}
</style>
